<template>
	<view class="content">
		<slide-choose :width="100" :bigItemWidth="5" :littleItemWidth="5" @change="chooseChange" height="300rpx"
			:cellWidth="20" :cells="5" :cellNum="0.5" :startNum="10" :endNum="30"
			bgColor="linear-gradient(to right, #b0a4e3, #801dae)" color="#fff" :bigItemHeight="40"
			:littleItemHeight="20" selColor="#0ff" align="center" numPos="top" v-model="value"></slide-choose>
		<view class="handle">
			<button type="default" @tap="handleEdit">修改值 +1</button>
			<view>当前值：{{value}}</view>
		</view>
	</view>
</template>

<script>
	import slideChoose from '@/components/dlm-slide-choose/dlm-slide-choose.vue';
	export default {
		components: {
			slideChoose
		},
		data() {
			return {
				value: 10,
			}
		},
		onLoad() {

		},
		methods: {
			chooseChange(e) {
				console.log(e)
			},
			handleEdit() {
				const {
					value
				} = this;
				if (value >= 0) {
					this.value++;
				}
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.handle {
		display: flex;
		align-items: center;
		width: 100%;
		padding: 100rpx 0;
		justify-content: space-around;
	}

	button {
		margin: 0;
	}
</style>
